<template>
    <div class="video-player">
        <div class="video-title">视频{{ playerId }}</div>
        <img ref="canvas" class="video-canvas" :src="videoSrc" />
    </div>
</template>

<script setup>
import { ref, defineProps } from 'vue';

const props = defineProps({
    videoSrc: {
        type: String,
        required: true
    },
    playerId: {
        type: Number,
        required: true
    }
});
</script>

<style scoped>
.video-player {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: black;
    text-align: center;
}

.video-title {
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    font-size: 14px;
    color: white;
}

.video-canvas {
    width: 100%;
    height: calc(100% - 20px);
    margin-top: 20px;
    background-color: black;
}
</style>
